-
Notifications
You must be signed in to change notification settings - Fork 0
fix: fix cache analysis not rendering when edge cache miss occurs #92
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
…ders Co-authored-by: serhalp <1377702+serhalp@users.noreply.github.com>
Co-authored-by: serhalp <1377702+serhalp@users.noreply.github.com>
serhalp
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
this project uses pnpm. delete the lockfile.
…revert import changes Co-authored-by: serhalp <1377702+serhalp@users.noreply.github.com>
Done! Deleted the package-lock.json file since the project uses pnpm. (fb52dda) |
…he miss instead of loops Co-authored-by: serhalp <1377702+serhalp@users.noreply.github.com>
app/utils/getServedBy.ts
Outdated
| // Check for the specific case of a single Netlify Edge miss - this handles the weird | ||
| // Netlify Cache-Status behavior where a miss on the CDN edge means the request was | ||
| // forwarded to CDN origin. According to Netlify's cache behavior, when there's a miss | ||
| // on "Netlify Edge", the request gets forwarded to the CDN origin to fetch the static asset. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
there's one detail missing here. this only applies when there's a miss on the edge node, but a hit at the CDN origin. This can only be detected by the presence of a cache status entry for Netlify Edge that is a miss and no entries at all for subsequent caches. There's a miss on the edge node, but a hit at the CDN origin. This can only be detected by the presence of a cache status entry for Netlify Edge that is a miss and no entries at all for subsequent caches.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Fixed the CdnOrigin detection logic to properly handle the case you described. Now checks for Netlify Edge miss AND no subsequent cache hits (not just single entry). This correctly detects when there's a miss on edge but hit at CDN origin. (fc87dc2)
…logic Co-authored-by: serhalp <1377702+serhalp@users.noreply.github.com>
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is the final PR Bugbot will review for you during this billing cycle
Your free Bugbot reviews will reset on December 6
Details
You are on the Bugbot Free tier. On this plan, Bugbot will review limited PRs each billing cycle.
To receive Bugbot reviews on all of your PRs, visit the Cursor dashboard to activate Pro and start your 14-day free trial.
Co-authored-by: serhalp <1377702+serhalp@users.noreply.github.com>
💡 You can make Copilot smarter by setting up custom instructions, customizing its development environment and configuring Model Context Protocol (MCP) servers. Learn more Copilot coding agent tips in the docs.
Note
Differentiate CDN edge vs origin in served-by logic; add CdnOrigin detection on single Netlify Edge miss and update tests accordingly.
app/utils/getServedBy.ts)ServedBySource.CdnEdgeandServedBySource.CdnOrigin; replace formerCDNwithCdnEdgemapping for"Netlify Edge"hits.Cache-Statuscontains a single"Netlify Edge"entry with a miss, returnCdnOrigin.Functionheader >EdgeFunctionheader; throw error otherwise.CDNtoCdnEdgeingetServedBy.test.tsandgetCacheAnalysis.test.ts.CdnOriginon Netlify Edge miss (including lowercase header variants) and scenarios mixing misses/hits.Netlify Edgewhen validating other sources (e.g.,DurableCache,Function,EdgeFunction).Written by Cursor Bugbot for commit f9c29a7. This will update automatically on new commits. Configure here.